package cn.wanho.service.impl;

import cn.wanho.dao.CmsClassStageMapper;
import cn.wanho.dto.CmsClassStage;
import cn.wanho.rvo.ResultEnum;
import cn.wanho.rvo.ResultVO;
import cn.wanho.service.CmsClassStageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service
public class CmsClassStageServiceImpl implements CmsClassStageService {
    @Resource
    private CmsClassStageMapper cmsClassStageMappper;
    @Override
    public ResultVO setClassStage(CmsClassStage cmsClassStage) {
        int i = cmsClassStageMappper.insert(cmsClassStage);
        if (i>0) {
            return ResultVO.success(ResultEnum.SET_CLASS_STAGE_SUCCESS.getResCode(),ResultEnum.SET_CLASS_STAGE_SUCCESS.getResMsg());
        }else{
            return ResultVO.failure(ResultEnum.SET_CLASS_STAGE_FAILURE.getResCode(),ResultEnum.SET_CLASS_STAGE_FAILURE.getResMsg());

        }
    }

    @Override
    public Integer getClassStage(Integer paperId) {
        return cmsClassStageMappper.getClassStage(paperId);
    }
}
